module.service('RechargeOrder', ['$rootScope', function ($rootScope) {
    var service = {
        _baseUrl: "/azeroth/back/tran/",

        currentProperty: {},
        rechargeOrderList: [],
        totalSceneCount: 0,
        
        queryList: function (rechargeOrderNo, outOrderNo, status, currentPage, pageSize, callback) {

            var paramData = {
            	rechargeOrderNo: rechargeOrderNo,
            	outOrderNo: outOrderNo,
            	status: status,
//            	startTime: startTime,
//            	endTime: endTime,
            	pageNum: currentPage,
                start: (currentPage - 1) * pageSize,
                pageSize: pageSize,
            };
            
            $rootScope.ajaxRequestPost(service._baseUrl + "getRechargeOrderList.htm", paramData, function (resultJson) {
                angular.copy(resultJson.data, service.rechargeOrderList);
                service.totalSceneCount = resultJson.totalCount;
                
                if (callback) {
                    callback();
                }
            });

        },
        
        confirmRechargeOrder: function (rechargeOrderNo, callback) {
            var paramData = {
            	rechargeOrderNo: rechargeOrderNo
            };
            
            $rootScope.ajaxRequestPost(service._baseUrl + "confirmRechargeOrder.htm", paramData, function (resultJson) {
                if (callback) {
                    callback();
                }
            });
        }
    };
    return service;
}]);
